package com.ruoyi.project.system.sample.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.sample.mapper.MySampleMapper;
import com.ruoyi.project.system.sample.domain.MySample;
import com.ruoyi.project.system.sample.service.IMySampleService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 做样信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-15
 */
@Service
public class MySampleServiceImpl implements IMySampleService 
{
    @Autowired
    private MySampleMapper mySampleMapper;

    /**
     * 查询做样信息
     * 
     * @param id 做样信息主键
     * @return 做样信息
     */
    @Override
    public MySample selectMySampleById(Long id)
    {
        return mySampleMapper.selectMySampleById(id);
    }

    /**
     * 查询做样信息列表
     * 
     * @param mySample 做样信息
     * @return 做样信息
     */
    @Override
    public List<MySample> selectMySampleList(MySample mySample)
    {
        return mySampleMapper.selectMySampleList(mySample);
    }

    /**
     * 新增做样信息
     * 
     * @param mySample 做样信息
     * @return 结果
     */
    @Override
    public int insertMySample(MySample mySample)
    {
        mySample.setCreateTime(DateUtils.getNowDate());
        return mySampleMapper.insertMySample(mySample);
    }

    /**
     * 修改做样信息
     * 
     * @param mySample 做样信息
     * @return 结果
     */
    @Override
    public int updateMySample(MySample mySample)
    {
        mySample.setUpdateTime(DateUtils.getNowDate());
        return mySampleMapper.updateMySample(mySample);
    }

    /**
     * 批量删除做样信息
     * 
     * @param ids 需要删除的做样信息主键
     * @return 结果
     */
    @Override
    public int deleteMySampleByIds(String ids)
    {
        return mySampleMapper.deleteMySampleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除做样信息信息
     * 
     * @param id 做样信息主键
     * @return 结果
     */
    @Override
    public int deleteMySampleById(Long id)
    {
        return mySampleMapper.deleteMySampleById(id);
    }
}
